import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { registerMicroApps, start } from 'qiankun';
import { BrowserRouter } from 'react-router-dom';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <BrowserRouter >
      <App />
    </BrowserRouter>
  </React.StrictMode>
);

registerMicroApps([
  {
    name: 'reactApp',
    entry: '//localhost:3000', // React 子应用的启动地址
    container: '#micro-app-container1', // 子应用挂载的容器
    activeRule: '/react-app', // 激活规则
  },
  {
    name: 'vueApp', // 子应用名称
    entry: '//localhost:3001', // 子应用入口地址
    container: '#micro-app-container2', // 挂载节点
    activeRule: '/vue-app', // 激活规则
  },
]);

start();

reportWebVitals();
